#pragma once
#include "CTokens.h"
#include "CFileSystem.h"

class CConsoleScript
{
	CFile			*	m_pScriptFile;
	CFileData		*	m_pSourceFile;
	CFileData		*	m_pCompiledFile;
	CLListEx<CToken*>	m_Tokens;

	CConsoleScript(const char * szFilePath)
	{
		if(m_pScriptFile = new CFile(szFilePath, FILE_MODE_READ, FILE_TYPE_TEXT))
		{
			if(m_pScriptFile->OK())
			{

			}
			else THROW("Failed to open console script '%s'", szFilePath);
			delete m_pScriptFile;
		}
	}
};

class CScriptEngine
{
	CDirectory		*	m_ScriptsDir;

public:
	CScriptEngine()		:	m_ScriptsDir(new CDirectory("scripts", true, "*.scc"))
	{
		m_ScriptsDir->FindFiles("*.scs");
		for(auto pLink = m_ScriptsDir->Begin(); pLink != m_ScriptsDir->Bad(); ++pLink)
		{
			if(pLink->IsExtension("scs"))
			{
				Print("Found .scs file");
			}
		}
	}
};

extern class CScriptEngine		ScriptEngine;